<template>
	<!-- 查看图片、pdf文件、word文件等对话框 查看链接，通过链接跳转查看文件 -->
	<v-dialog v-model="filesModel.dialog" max-width="600px">
		<v-card>
			<v-card-title>
				<span class="text-h5">查看文件</span>
			</v-card-title>
			<v-card-text>
				<v-container>
					<v-row>
						<v-col cols="12" v-for="file in  filesModel.files" :key="file.originalname">
							<a :href="file.link" target="_Blank">{{file.originalname}}</a>
						</v-col>
					</v-row>

				</v-container>
			</v-card-text>
			<v-card-actions>
				<v-spacer></v-spacer>
				<v-btn color="blue darken-1" text @click="cannel">
					退出
				</v-btn>
			</v-card-actions>
		</v-card>

	</v-dialog>
</template>

<script>
	export default {
		name: 'ShowFilesDialog',
		props: {
			filesModel: {
				dialog: false,
				files: []
			},
		},
		watch: {
			filesModel: {
				handler(newVal) {
					this.$emit('update:filesModel', newVal)
				},
				deep: true
			},
		},
		methods: {
			cannel() {
				this.filesModel.dialog = false
				this.files = []
			},
		}
	}
</script>

<style>
</style>
